Timestamp

Hello,

Is there a build in feature for timestamps I am trying to print the time in the following format 2:12:78 PM?

-Jim
SystemAdmin - Wed Mar 14 15:21:08 EDT 2012

Re: Timestamp
SystemAdmin - Wed Mar 14 17:10:56 EDT 2012

I think the closest you will get it to use the dateAndTime() library function which returns a value of type Date - this Date type can be easily converted into a string, for example:
 

string s
s = stringOf(dateAndTime(today))
print s

 


This will produce an output string in the format of MM/DD/YY HH:MM:SS

 

 

 


Paul Miller
Melbourne, Australia

 

 

Re: Timestamp
JesLewis - Tue Mar 27 14:01:59 EDT 2012

void doClock(DBE dbe)
{
Date d = null
int currentTime = null
int seconds = 0
int minutes = 0
int hours = 0
int days = 0

d = today
currentTime = intOf(d)
elapsedTime = currentTime - startTime
seconds = elapsedTime % 60
minutes = (elapsedTime % 3600) / 60
hours = (elapsedTime % 86400) / 3600
days = elapsedTime / 86400
string s1 = days " d:" hours " h:" minutes " m:" seconds " s"
set (dbeTime, s1)
}

This is part of a stop watch feature i developed but it does break up the hours minutes days and it will continue counting while open. I guess you could just have it save the elapsted time to current time and print that as your final variable